//
//  TrainDetailController.m
//  TrainT1
//  $Id: TrainDetailController.m 46 2010-06-13 08:36:47Z qiaolun $
//
//  Created by Qiao Lun on 6/5/10.
//  Copyright 2010 Koolanoo Group. All rights reserved.
//

#import "TrainDetailController.h"


@implementation TrainDetailController

- (NSTableView *) table_view_detail {
	return [[table_view_detail retain] autorelease];
}
- (void) setTable_view_detail:(NSTableView *) detail {
	[table_view_detail autorelease];
	table_view_detail = [detail retain];
}

- (NSArray *) tableDataDetail {
	return [[tableDataDetail retain] autorelease];
}
- (void) setTableDataDetail:(NSArray *)data {
	[tableDataDetail autorelease];
	tableDataDetail = [data retain];
}

- (NSWindow *) train_detail_window {
	return [[train_detail_window retain] autorelease];
}
- (void) setTrain_detail_window:(NSWindow *)win {
	[train_detail_window autorelease];
	train_detail_window = [win retain];
}

- (int) numberOfRowsInTableView:(NSTableView *)aTableview {
	return [tableDataDetail count];
}

- (id) tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)column row:(int)row {
	
	NSString *col_id = [column identifier];
	// NSLog(@"%@", [tableData objectAtIndex:row]);
	NSString *content = [[tableDataDetail objectAtIndex:row] objectForKey:col_id];
	if([content isEqualToString:@""]){
		content = @"--";
	}
	return content;
	// return [NSString stringWithFormat:@"row: %@, col: %d", [aTableColumn identifier], rowindex];
}


@end
